/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *																 *
 *	TrabP2 - Trabalho P2										 *
 *																 *
 *	File:		Estudo1.cpp										 *
 *	Authors:	Rafael Kikuchi ( shinjikik@gmail.com )			 *
 *				Rafael Romeiro ( rafaelromeiro@gmail.com )		 *
 *	Date:		24/10/2008										 *
 *	License:	CC-GNU LGPL										 *
 *				http://creativecommons.org/licenses/LGPL/2.1/	 *
 *	Version:	0.1.0											 *
 *																 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <iostream>
#include <vector>

#include "Estudo1.h"

void Estudo1::init (bool Directed, int StructType, string FileName)
{
	fileName = FileName;

	cout << "Loading Graph (" << FileName << ")...";
	myGraph = new Graph(FileName.c_str(), Directed, StructType);
	cout << " Done!" << endl;
}

void Estudo1::go (void)
{
	vector< float > results;

	cout << "Getting Mean Distance and Diameter...";
	myGraph->GetMeanDistanceAndDiameter(results);
	ofstream output(( "[" + fileName + "] MeanDistanceAndDiameter.txt" ).c_str());
	output << "Mean Distance = " << results[0] << endl;
	output << "Diameter = " << results[1] << endl;
	cout << " Done!" << endl;
	output.close();
}

void Estudo1::release (void)
{
	delete myGraph;
}
